import { createRouter, createWebHistory } from "vue-router";
import routeData from "./routeData";

const routerHistory = createWebHistory();

const router = createRouter({
  history: routerHistory,
  routes: routeData,

  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition;
    } else {
      return { top: 0 };
    }
  },
});
export default router;
